import 'package:distribution_mall_flutter/constant/cf_constant.dart';
import 'package:distribution_mall_flutter/generated/l10n.dart';
import 'package:distribution_mall_flutter/widgets/ink_well_view.dart';
import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

class MessageCard extends StatelessWidget {
  const MessageCard({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: EdgeConstant.edge20),
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(8),
          boxShadow: const [
            BoxShadow(
                color: Color.fromRGBO(0, 0, 0, 0.1),
                offset: Offset(0, 2),
                spreadRadius: 1,
                blurRadius: 6)
          ]),
      child: Stack(
        children: [
          const Positioned(
            right: 15,
            bottom: 3,
            child: GFBadge(
              color: Color.fromRGBO(227, 77, 89, 1),
              shape: GFBadgeShape.circle,
              size: 12,
            ),
          ),
          EPInkWellView(
            onPressed: () {},
            child: Padding(
              padding: const EdgeInsets.all(EdgeConstant.edge10),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    S.of(context).message_title,
                    style: const TextStyle(
                        color: ColorConstant.black,
                        fontSize: FontConstant.f16,
                        fontWeight: FontWeight.bold),
                  ),
                  Padding(
                    padding: const EdgeInsets.symmetric(
                        vertical: EdgeConstant.edge10),
                    child: Row(
                      children: [
                        Padding(
                          padding:
                              const EdgeInsets.only(right: EdgeConstant.edge5),
                          child: ClipRRect(
                            borderRadius: BorderRadius.circular(8),
                            child: Image.network(
                              "https://avatars2.githubusercontent.com/u/20411648?s=460&v=4",
                              width: 90,
                              height: 90,
                            ),
                          ),
                        ),
                        const Expanded(
                          child: Text(
                            '123123123salkdifjhasfkljasdhfg kljhflkjasdhfjkl asdhfklja sdhfjkl haslkjfh askljhf aklsjhf kjlashfkjlsadhfjklsadhf lsakjdhf sajklhf sajklfhs akljhfsaljk h',
                            maxLines: 4,
                            overflow: TextOverflow.ellipsis,
                            style: TextStyle(
                              color: ColorConstant.black,
                              fontSize: FontConstant.f12,
                            ),
                          ),
                        )
                      ],
                    ),
                  ),
                  const Flex(
                    direction: Axis.horizontal,
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                      Text(
                        'PO0275332569229742182400',
                        style: TextStyle(
                          color: ColorConstant.grey888,
                          fontSize: FontConstant.f12,
                        ),
                      ),
                      Text(
                        '04:00',
                        style: TextStyle(
                          color: ColorConstant.grey888,
                          fontSize: FontConstant.f12,
                        ),
                      ),
                    ],
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
